package com.admin.qanda;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import com.vo.QnABoardVO;


public class SqlMapAdminDao extends SqlMapClientDaoSupport{
	Logger logger = Logger.getLogger(SqlMapAdminDao.class);
	public void write(Map<String, Object> pMap) throws DataAccessException{
		logger.info("===SqlMapAdminDao boardInsert call===");
		getSqlMapClientTemplate().insert("write",pMap);
	}
	public List<HashMap> getBoardList() {
		logger.info("===SqlMapAdminDao getBoardList call===");
		return getSqlMapClientTemplate().queryForList("getBoard");
	}
	public QnABoardVO boardDetail(int seq) throws DataAccessException{
		logger.info("===SqlMapAdminDao boardDetail call===");
		return (QnABoardVO)getSqlMapClientTemplate().queryForObject("detail",seq);
	}
	public void answer(Map<String, Object> pMap) throws DataAccessException{
		getSqlMapClientTemplate().insert("answer",pMap);
	}
	public void answercheck(Map<String, Object> pMap) {
		getSqlMapClientTemplate().insert("answercheck",pMap);
		
	}
	public void delete(Map<String, Object> pMap) {
		getSqlMapClientTemplate().insert("delete",pMap);
		
	}
}
